import http from '@/api';
import { ADMIN_PREFIX_V2 } from '@/api/helper/prefix';

//获取客户列表
export const getClientList = params => {
  return http.get(ADMIN_PREFIX_V2 + `/basic_client/list`, params);
};

//保存客户
export const createClient = params => {
  return http.post(ADMIN_PREFIX_V2 + `/basic_client/create`, params);
};

//更新客户
export const updateClient = params => {
  return http.post(ADMIN_PREFIX_V2 + `/basic_client/update`, params);
};

//删除客户
export const deleteClient = params => {
  return http.post(ADMIN_PREFIX_V2 + `/basic_client/delete`, params);
};

//修改客户状态
export const updateClientStatus = params => {
  return http.post(ADMIN_PREFIX_V2 + `/basic_client/update-state`, params);
};

//导出客户信息
export const exportClient = params => {
  return http.download(ADMIN_PREFIX_V2 + `/basic_client/export`, params);
};

//导入客户信息
export const importClient = (params, config) => {
  return http.upload(ADMIN_PREFIX_V2 + `/basic_client/import`, params, config);
};
